import request from '@/utils/request'

// 查询月排班列表
export function listMonthschedule(query) {
  return request({
    url: '/business/monthschedule/list-of-dept',
    method: 'get',
    params: query
  })
}

// 查询月排班详细
export function getMonthschedule(id) {
  return request({
    url: '/business/monthschedule/' + id,
    method: 'get'
  })
}

// 新增月排班
export function addMonthschedule(data) {
  return request({
    url: '/business/monthschedule',
    method: 'post',
    data: data
  })
}


// 智能月排班
export function aiMonthschedule(data) {
  return request({
    url: '/business/monthschedule/ai',
    method: 'post',
    data: data
  })
}

// 修改月排班
export function updateMonthschedule(data) {
  return request({
    url: '/business/monthschedule',
    method: 'put',
    data: data
  })
}

// 删除月排班
export function delMonthschedule(id) {
  return request({
    url: '/business/monthschedule/' + id,
    method: 'delete'
  })
}

// 导出月排班
export function exportMonthschedule(query) {
  return request({
    url: '/business/monthschedule/export',
    method: 'get',
    params: query
  })
}

// 获得部门的班次定义（不分页）
export function getDefineByOrgId(orgId) {
  return request({
    url: '/monthschedule/define/list-by-orgid?orgId=' + orgId,
    method: 'get'
  })
}
